package com.pkuse.bjousystem;

public class PasswordAuthEntity implements AuthEntity {

    SchoolPasswordConfiguration config;

    private AuthEntity delegate;

    public PasswordAuthEntity(AuthEntity delegate, SchoolPasswordConfiguration config) {
        this.delegate = delegate;
        this.config = config;
    }

    @Override
    public String getAuthUsername() {
        return delegate.getAuthUsername();
    }

    @Override
    public String getAuthPassword() {
        return delegate.getAuthPassword() + config.getPassword(delegate.getAuthUsername());
    }

    @Override
    public AuthType getAuthType() {
        return delegate.getAuthType();
    }

}
